<template>
    <div class="company-user">
        <index-breadcrumb :breadcrumb-list="breadcrumbList"></index-breadcrumb>
        <mediumCount :operation-list="operationList" :is-show="showStatus"></mediumCount>
    </div>
</template>

<script>
import mediumCount from "@/views/mediumCount/includes/MediumCount";

export default {
    name: "MediumCount",
    components: {
        mediumCount,
    },
    data() {
        return {
            operationList: [],
            breadcrumbList: [
                {
                    title: "媒体统计"
                },
            ],
            showStatus: true,
        };
    },
    created() {
        this.getOperationList();
    },
    methods: {
        backShow() {
            this.showStatus = true
        },
        getOperationList() {
            this.$store.state.permissionList.forEach(item => {
                const [itemName] = item.permission.split(":");
                if (itemName === "mediumCount") {
                    this.operationList = item.list.map(listItem => {
                        return listItem.permission.split(":")[1];
                    });
                }
            });
        }
    },
    beforeRouteLeave(to, from, next) {
        this.$bus.$emit('clearSearchParams')
        next()
    },
};
</script>

<style lang="sass" scoped>

</style>
